Loading...
 

String (Widget)

String, Str

String(name~aliasName, flags, x, y, w)

Parameters
Parameters Description
name * Identifier
aliasName an additional identifier
flags Flags
x * Position X (in minicells)
y * Position Y (in Minicells)
w * Width (in minicells)
  • - Required parameter

The tuple (class, access expression) defines an image on model data (see FillWindow, DrainWindow).

It is possible to change the font colour in the widget. For this purpose, only the colour name, e.g. LIGHTRED, is specified as a flag

Flags
Flag Description
HIDDEN The input field remains invisible until instruction Show makes it appear on the screen.
VIEW_ONLY The input field can only display data, but you cannot enter characters interactively.
LOCKED The widget is locked. This state can be unlocked by Unlock.
NON_SELECTABLE You can neither select the input field with the mouse nor with the keyboard and therefore cannot enter any characters. Data is displayed in grey.
JUSTIFY_RIGHT The text in the input field appears right-aligned. This flag is only useful if the width of the prompt is explicitly specified.
JUSTIFY_CENTER The text in the input field appears centred. This flag is only useful if the width of the prompt is explicitly specified.
FONT(k) k = 0, 1, ..., 9 selects an entry in the font table. The font entered there is used. Fonts are entered into the table with PMFonts. Predefined fonts exist for 0, 1 and 2. The font index can be changed later with SetFont.
MIN_HEIGHT(h) The height of the widget never falls below the value h (specified in minicells). This is especially useful in combination with attachments.
MIN_WIDTH(w) Width of the widget never falls below the value w (specified in minicells). This is especially useful in combination with attachments.
NO_DRAIN The input field is filled by FillWindow, but ignored by DrainWindow.
NO_CLEAR ClearWindow does not delete the input field.
TOOLTIP(mlString) The specified string is displayed as a tooltip or, if an event TOOLTIP is also defined, is passed to it. The tooltip is automatically triggered by the system after a certain period of time when the mouse cursor remains over the window object. The string can be multilingual. The current language is passed to the event.
CONTEXTMENU(identifier)

The identifier is an identifier of an item within a Menu or ContextMenuList declaration. The submenu hanging under this item is automatically displayed when the right mouse button is pressed. If thereupon a menu item is selected, the respective action is started as described for item, in the same way as if the menu item had been called from the main menu.
In addition, however, when SELECT is executed for the corresponding item with GetCurrentWidget you can determine from which window object the menu item was called via ContextMenu. With a call from the main menu GetCurrentWidget returns NULL.

If a ContextMenu should not appear automatically, then it can be called (according to design guidelines this should be done as reaction to the right mouse button, thus within MOUSE_CLICK_R ) by means of PopupMenu also from InstantView®. In this case you should not use the CONTEXTMENU flag, otherwise the menu will appear twice (once automatically, once controlled).

LIGHTRED

The font colour in the text field appears in red. Other colours are also possible. Please note that the usually prefixed COLOR leads to a syntax error, so please only specify the colour!

OVERWRITE statement DrainWindow writes to the data field connected to the window object such as Put(..., OVERWRITE). This flag is only effective if DrainWindow is executed for an object of the class CX_OVERWIRTING_REF (or one derived from it).
VOLATILE, VOLATILE(identifier)

The input field should only be visible if the date to be displayed also exists, otherwise it is automatically hidden by FillWindow. When is data missing in an object? This is the case

  • if a slot does not exist in the object
  • if a pointer in the access path has the value NULL
  • if a function in the access path returns NULL.
  • when accessing the k-th element of a collection with cardinality < k

For example, a function can be used to decide at any point in the access imprint whether it should be followed up or not. Often other window objects - e.g. the prompt belonging to the input field - should also be shown and hidden. For these objects, the VOLATILE flag is specified with the same identifier, which here identifies a group of logically related window objects. If a window object refers directly to a 'normal' data member of a model object, the VOLATILE flag is meaningless and without function.

PASSWORD Entered characters are displayed as *.
LOWER_CASE Entered characters are converted to lower case.
UPPER_CASE Entered characters are converted to upper case.
HELP(anchor) Help("file~anchor") connects the window object with online help in HTML format. If no file name is specified, the HTML file specified in the module applies.
HELP(s)

If you prefer to use the platform's help system (OS/2 PM, MS Windows), enter an integer n which refers to the corresponding help window. Where n must be < 40000.

Note: HTML is recommended as the online help for InstantView® application for portability reasons.

See also